﻿using System;
using System.Collections.Generic;
using System.Data.Objects.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZBJF.Warranty.Common.Common;
using ZBJF.Warranty.Common.Enums.InsuranceWarranty;
using ZBJF.Warranty.Model;
using ZBJF.Warranty.Model.ViewModel.InsuranceWarranty;

namespace ZBJF.Warranty.BLL
{
    public partial class ProcessLogsService
    {

        /// <summary>
        /// 分页获取流程日志
        /// </summary>
        /// <param name="model"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public IQueryable<ProcessLogs> GetPagingList(ProcessLogsModel model, out int total)
        {
            var whereExpression = PredicateExtensions.True<ProcessLogs>();

            if (model.InsuranceWarrantyRecordId > 0)
                whereExpression = whereExpression.And(t => t.InsuranceWarrantyRecordId == model.InsuranceWarrantyRecordId);

            return LoadPagerEntities<ProcessLogs>(model.PageIndex, model.iDisplayLength, out total,
                whereExpression, model.iSorts);
        }
    }
}
